package com.base.service.workflow.entity;

import com.base.core.framework.sql.entity.BaseV1Ext;
import com.base.core.head.enums.TaskTypeEnum;
import com.base.service.workflow.bo.AssigneeConfigBO;
import com.base.service.workflow.converter.AssigneeConfigConverterEditor;
import com.gitee.magic.core.converter.PropertyConverter;
import com.gitee.magic.jdbc.persistence.annotation.Entity;
import com.gitee.magic.jdbc.persistence.annotation.Table;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.ColumnDef;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.Indexes;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.IndexesUnion;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.ScriptConverter;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.TableDef;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.indexes.Normal;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.indexes.UniqueUnion;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.converter.FieldText;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author start 
 */
@Getter@Setter@ToString
@Entity("task")
@Table("wor_task")
@TableDef(comment = "流程任务", 
indexes = @IndexesUnion(unique = @UniqueUnion(fields = {"deploymentId","name"})))
public class TaskDO extends BaseV1Ext {

	private static final long serialVersionUID = 1L;
	
	public TaskDO(){}

	@ColumnDef(indexes = @Indexes(normal = @Normal),comment = "流程部署ID")
    private Long deploymentId;

	@ColumnDef(indexes = @Indexes(normal = @Normal),length = 32,comment = "名称")
	private String name;

	@ColumnDef(comment = "标签")
    private String label;

	@ColumnDef(comment = "类型")
    private TaskTypeEnum taskType;

	@PropertyConverter(AssigneeConfigConverterEditor.class)
	@ScriptConverter(FieldText.class)
	@ColumnDef(comment = "数据",isNull = true)
	private AssigneeConfigBO data;
	
}
